package com.mh.study.jackson.annotations;

import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonSetter;

/**
 * @author meng.han
 * @since 2021-11-26
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class MyBean {
    public int id;
    private String name;

    public MyBean() {
    }

    public MyBean(int id, String name) {
        this.id = id;
        this.name = name;
    }

    @JsonSetter("name")
    public void setTheName(String name) {
        this.name = name;
    }

    @JsonGetter("name")
    public String getTheName() {
        return name;
    }
}
